package common

type Config struct {
	Mysql   _mysql   `mapstructure:"mysql"`
	Redis   _redis   `mapstructure:"redis"`
	Session _session `mapstructure:"session"`
}

type _mysql struct {
	Username     string `mapstructure:"username" json:"username" yaml:"username"`
	Password     string `mapstructure:"password" json:"password" yaml:"password"`
	Path         string `mapstructure:"path" json:"path" yaml:"path"`
	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
	Config       string `mapstructure:"config" json:"config" yaml:"config"`
	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
	TablePrefix  string `mapstructure:"table-prefix" json:"TablePrefix" yaml:"table-prefix"`
	//是否使用单数表名
	SingularTable bool `mapstructure:"singular-table" json:"SingularTable" yaml:"singular-table"`
}

type _redis struct {
	Addr     string `mapstructure:"addr"`
	Password string `mapstructure:"password"`
	Db       int    `mapstructure:"db"`
}

type _session struct {
	Key  string `mapstructure:"key"`
	Name string `mapstructure:"name"`
}
